from XmTestLib import *
+from vtpm_utils import *
import commands
import os
-def vtpm_cleanup(domName):
- # Since this is only a temporary domain I clean up the domain from the
- # virtual TPM directory
- os.system("/etc/xen/scripts/vtpm-delete %s" % domName)
-
-if ENABLE_HVM_SUPPORT:
- SKIP("vtpm-list not supported for HVM domains")
-
config = {"vtpm":"instance=1,backend=0"}
domain = XmTestDomain(extraConfig=config)
# check list of pcrs
from XmTestLib import *
+from vtpm_utils import *
import commands
import os
import os.path
-def vtpm_cleanup(domName):
- # Since this is only a temporary domain I clean up the domain from the
- # virtual TPM directory
- os.system("/etc/xen/scripts/vtpm-delete %s" % domName)
-
-if ENABLE_HVM_SUPPORT:
- SKIP("vtpm-list not supported for HVM domains")
-
-if os.path.exists("/dev/tpm0") == False:
- SKIP("This machine has no hardware TPM; cannot run this test")
-
-output = commands.getoutput("ps aux | grep vtpm_manager | grep -v grep")
-if output == "":
- SKIP("virtual TPM manager must be started to run this test")
-
-# vtpm manager has been detected
config = {"vtpm":"instance=1,backend=0"}
domain = XmTestDomain(extraConfig=config)
# check list of pcrs again
from XmTestLib import *
+from vtpm_utils import *
import commands
import os
import os.path
-def vtpm_cleanup(domName):
- # Since this is only a temporary domain I clean up the domain from the
- # virtual TPM directory
- os.system("/etc/xen/scripts/vtpm-delete %s" % domName)
-
-if ENABLE_HVM_SUPPORT:
- SKIP("vtpm-list not supported for HVM domains")
-
-if os.path.exists("/dev/tpm0") == False:
- SKIP("This machine has no hardware TPM; cannot run this test")
-
-output = commands.getoutput("ps aux | grep vtpm_manager | grep -v grep")
-if output == "":
- SKIP("virtual TPM manager must be started to run this test")
-
-# vtpm manager has been detected
config = {"vtpm":"instance=1,backend=0"}
domain = XmTestDomain(extraConfig=config)
-
SUBDIRS =
TESTS = 01_vtpm-list_pos.test \
XFAIL_TESTS =
-EXTRA_DIST = $(TESTS) $(XFAIL_TESTS)
-
+EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) vtpm_utils.py
TESTS_ENVIRONMENT=@TENV@
%.test: %.py
--- /dev/null
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2006
+# Author: Stefan Berger <stefanb@us.ibm.com>
+
+from XmTestLib import *
+
+if ENABLE_HVM_SUPPORT:
+ SKIP("vtpm tests not supported for HVM domains")
+
+if not os.path.isfile("/dev/tpm0"):
+ SKIP("This machine has no hardware TPM; cannot run this test")
+
+status, output = traceCommand("ps aux | grep vtpm_manager | grep -v grep")
+if output == "":
+ FAIL("virtual TPM manager must be started to run this test")
+
+def vtpm_cleanup(domName):
+ traceCommand("/etc/xen/scripts/vtpm-delete %s" % domName)